package com.sunjy.apollo1.controller;

import com.sunjy.apollo1.services.PersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.sunjy.common.annotation.BeanValid;
import com.sunjy.common.domain.ApiResponseT;

import lombok.extern.slf4j.Slf4j;

/**
 * 
 * @author sunjy
 *
 */
@RestController
@RequestMapping("tk")
@Slf4j
public class TestTkMybatisController {
	
	@Autowired
	private PersonService personService;

	@BeanValid
    @GetMapping(value = "/testInsert",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ApiResponseT<Object> testInsert(){
		return personService.insert();
         
    }
	
	@BeanValid
    @GetMapping(value = "/testSelect",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ApiResponseT<Object> testSelect(){
        return personService.select();

    }
	
	@BeanValid
    @GetMapping(value = "/testSelectExample",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ApiResponseT<Object> testSelectExample(){
        return personService.selectExample();

    }
}
